# _*_coding:utf-8_*_
from ATS.instrumentDriver.IVGeneralFunc import IVGeneralFunc_B2900A as IVGeneralFunc
from ATS.instrumentDriver.IVGeneralFunc import IVGeneralFunc_B1500A as IVGeneralFunc41500


def GeneralTest(Sweep, Step, Bias, Open, Meas_Range, Src_Range, Compliance, Remote_Sense, Meas_Seq, Meas_Pro, Common):
    IVGeneralFunc.init(Sweep, Step, Bias, Open, Meas_Range, Src_Range, Compliance, Remote_Sense, Meas_Seq, Meas_Pro,
                       Common)
    IVGeneralFunc.setup(Sweep, Step, Bias, Open, Meas_Range, Src_Range, Compliance, Remote_Sense, Meas_Seq, Meas_Pro,
                        Common)
    if Common["gs_flag"] == 0:
        IVGeneralFunc.srcmeassample(Bias, Open, Meas_Range, Src_Range, Compliance, Remote_Sense, Meas_Seq, Meas_Pro,
                                    Common)
    else:
        IVGeneralFunc.srcmeas(Sweep, Step, Bias, Open, Meas_Range, Src_Range, Compliance, Remote_Sense, Meas_Seq,
                              Meas_Pro, Common)


def GeneralTest41500(Sweep, Step, Bias, Open, Meas_Range, Src_Range, Compliance, Remote_Sense, Meas_Seq, Meas_Pro,
                     Common):
    IVGeneralFunc41500.init(Sweep, Step, Bias, Open, Meas_Range, Src_Range, Compliance, Remote_Sense, Meas_Seq,
                            Meas_Pro, Common)
    IVGeneralFunc41500.setup(Sweep, Step, Bias, Open, Meas_Range, Src_Range, Compliance, Remote_Sense, Meas_Seq,
                             Meas_Pro, Common)
    if Common["gs_flag"] == 0:
        IVGeneralFunc41500.srcmeassample(Bias, Open, Meas_Range, Src_Range, Compliance, Remote_Sense, Meas_Seq,
                                         Meas_Pro, Common)
    else:
        IVGeneralFunc41500.srcmeas(Sweep, Step, Bias, Open, Meas_Range, Src_Range, Compliance, Remote_Sense, Meas_Seq,
                                   Meas_Pro, Common)
